2 Least Common Ancestor
نویسندگان
چکیده
In particular, we are allowed to preprocess the texts in order to be able to answer the query faster. Our preprocessing choice was the use of a single suffix tree, in which all the suffixes of all the texts appear, each suffix ending with a distinct symbol that determines the text in which the suffix appears. In order to answer the query we reduced the problem to range-min queries, which in turn was reduced to the least common ancestor (LCA) problem on the cartesian tree of an array of numbers. The cartesian tree is constructed recursively by setting its root to be the minimum element of the array and recursively constructing its two subtrees using the left and right partitions of the array. The range-min query of an interval [i, j] is then equivalent to finding the LCA of the two nodes of the cartesian tree that correspond to i and j.
منابع مشابه
Winter School 2003, St. Petersburg The Least Common Ancestor Problem
The Least Common Ancestor Problem can be used to solve many other algorithmic problems on trees. It is shown that an efficient and simple solution is possible.
متن کاملLeast Common Ancestor Networks
Least Common Ancestor Networks (LCANs) are introduced and shown to be a class of networks that include fat-trees, baseline networks, SW-banyans and the router networks of the TRAC 1.1 and 2.0, and the CM-5. Some LCAN properties are stated and the permutation routing capabilities of an important subclass are analyzed. Simulation results for three permutation classes verify the accuracy of an ite...
متن کامل.1 Range Minimum Query (rmq) 1.2 Lowest Common Ancestor (lca)
We care not only about the value of the minimum element, but also about the index k of the minimum element between A[i] and A[j]; given the index, it is easy to look up the actual value of the minimum element, so it is a more interesting problem to find the index of the minimum element between A[i] and A[j]. The range minimum query problem is not a tree problem, but it closely related to a tree...
متن کاملService address routing: a network-embedded resource management layer for cluster computing
Service address routing is introduced as a novel and powerful paradigm for the integration of resource management functions into the interconnection fabric of cluster computers. SAR provides a ‘‘location independent’’ mechanism for the distribution of computations (services) among the computational resources of the cluster. The intelligence to allocate services and, later on, invoke their insta...
متن کاملA Version Numbering Scheme with a Useful Lexicographical Order
We describe a numbering scheme for versions with alternatives that has a useful lexicographical ordering. The version hierarchy is a tree. By inspection of the version numbers, we can easily determine whether one version is an ancestor of another. If so, we can determine the version sequence between these two versions. If not, we can determine the most recent common ancestor to these two versio...
متن کامل